<template>
	<view class="exam-item u-flex u-flex-between u-flex-items-center">
		<view>
			<view class="f-s-16 f-w-b">{{ info.name }}</view>
			<view class="f-s-12 u-m-t-16 u-info">{{ info.startAt }}</view>
		</view>
		<view class="u-flex u-flex-items-center">
			<block v-if="info.examinationUser">
				<view class="text-center u-m-r-40">
					<view class="score">{{ info.examinationUser.score }}</view>
					<view class="f-s-12 u-light-color ">得分</view>
				</view>
				<view class="right-icon" @click="toOver">
					<up-icon name="arrow-right" color="#1677FF" :size="8"></up-icon>
				</view>
			</block>
			<block v-else-if="info.status == 1">
				<up-button text="进入" color="#1677FF" :customStyle="{
					width: '120rpx',
					height: '56rpx',
					borderRadius: '16rpx'
				}" @click="toPost"> </up-button>
			</block>
		</view>
	</view>
</template>

<script setup>
	
	const props = defineProps({
		info: Object
	})
	
	const toOver = ()=>{
		uni.navigateTo({
			url: '/subPackages/examination/over?id=' + props.info.id
		})
	}
	
	const toPost = ()=>{
		uni.navigateTo({
			url: '/subPackages/examination/post?id=' + props.info.id
		})
	}

</script>

<style lang="scss" scoped>
	.exam-item {
		background: #FFFFFF;
		border-radius: 16rpx;
		border: 1rpx solid #EEEEEE;
		padding: 24rpx;
		margin-bottom: 24rpx;
	}

	.score {
		font-size: 48rpx;
		font-weight: bolder;
		color: #1677FF;
		line-height: 68rpx;
	}

	.right-icon {
		width: 32rpx;
		height: 32rpx;
		background: rgba(22, 119, 255, 0.1);
		border-radius: 32rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>